package com.example.oop.Repository;

import com.example.oop.POJO.ChatRoom;
import com.example.oop.POJO.ChessPlay;
import com.example.oop.POJO.Player;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface ChessPlayRepository extends JpaRepository<ChessPlay, Integer> {
    Optional<ChessPlay> findByTurn(String username);

    Optional<ChessPlay> findByPlayer1NameAndStatus(String player,Integer status);

    Optional<ChessPlay> findByPlayer2NameAndStatus(String player, Integer status);
}
